from google.appengine.ext import db

class User(db.Model):
    name = db.StringProperty(required=True)

class Topic(db.Model):
    name = db.StringProperty(required=True)

class BlogPost(db.Model):
    topic = db.ReferenceProperty(Topic, collection_name="blog_entries",
                                 required=True)
    title = db.StringProperty(required=True)
    body = db.TextProperty(required=True)
    posted_by = db.ReferenceProperty(User, collection_name="blog_entries",
                                     required=True)
    date_posted = db.DateProperty(auto_now_add=True)